package com.mcxx.modules.miniSalvation.order.listener;

import com.mcxx.modules.miniSalvation.family.service.write.SuspendMemberWriteService;
import com.mcxx.modules.miniSalvation.order.event.SuspendManageEvent;
import com.yinhai.ta404.core.transaction.annotation.TaTransactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Slf4j
@TaTransactional
@Component
public class SuspendManageListener implements ApplicationListener<SuspendManageEvent> {

    @Autowired
    private SuspendMemberWriteService suspendMemberWriteService;

    @Override
    public void onApplicationEvent(SuspendManageEvent event) {
        suspendMemberWriteService.suspendFamily(event.getParam(),event.getList(),event.getUserAccountVo());
    }
}
